﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NetSurveillance.WebApp.Foundations
{
    public class CacheContainer : PersistentDataContainer
    {
        public readonly string CacheKeyName = typeof (CacheContainer).Name;

        protected override IDictionary<string, object> RecoveryStore()
        {
            return HttpContext.Current.Cache[CacheKeyName] as Dictionary<string, object>;
        }

        protected override void PersistentStore(IDictionary<string, object> store)
        {
            HttpContext.Current.Cache[CacheKeyName] = store;
        }
    }
}